home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / wiggi_wa.swf / scripts / DefineSprite_320 / frame_8 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  11.7 KB  |  402 lines

  1. function onEnterFrame()
  2. {
  3.    if(convState == 0)
  4.    {
  5.       timer++;
  6.       if(bossNum == 1)
  7.       {
  8.          if(timer == 30)
  9.          {
  10.             STAGE.newMessage(400,75,"Uh Oh It\'s a STRANGER. Be Careful!",15,30,130,"Sound_UhOhStranger");
  11.          }
  12.          else if(timer == 170)
  13.          {
  14.             STAGE.newMessage(400,75,"If you want to pass, you must answer my questions correctly ...Mwahahaha",15,30,180,"Sound_Xave3","XAVE");
  15.          }
  16.          else if(timer == 340)
  17.          {
  18.             STAGE.newMessage(400,75,"Choose the right answers to beat him at his own game!",15,30,130,"Sound_RightAnswer");
  19.          }
  20.          else if(timer == 460)
  21.          {
  22.             STAGE.newMessage(400,75,"If I asked you to give me your address in a chat room, would you give it to me?",15,30,180,"Sound_Xave4","XAVE");
  23.             rightAnswer = false;
  24.          }
  25.          else if(timer == 580)
  26.          {
  27.             convState = 1;
  28.             answerBox.ready = true;
  29.          }
  30.       }
  31.       else if(bossNum == 2)
  32.       {
  33.          if(timer == 30)
  34.          {
  35.             STAGE.newMessage(400,75,"Uh Oh It\'s a STRANGER. Be Careful!",15,30,130,"Sound_UhOhStranger");
  36.          }
  37.          else if(timer == 170)
  38.          {
  39.             STAGE.newMessage(400,75,"You can only Pass here if you answer my three questions",15,30,180,"Sound_Tom1","TOM");
  40.          }
  41.          else if(timer == 340)
  42.          {
  43.             STAGE.newMessage(400,75,"Choose the right answers to beat him at his own game!",15,30,130,"Sound_RightAnswer");
  44.          }
  45.          else if(timer == 460)
  46.          {
  47.             STAGE.newMessage(400,75,"Would it be safe to tell me what pets you have at your house?",15,30,160,"Sound_Tom2","TOM");
  48.             rightAnswer = true;
  49.          }
  50.          else if(timer == 580)
  51.          {
  52.             convState = 1;
  53.             answerBox.ready = true;
  54.          }
  55.       }
  56.       else if(bossNum == 3)
  57.       {
  58.          if(timer == 30)
  59.          {
  60.             STAGE.newMessage(400,75,"Uh Oh It\'s a STRANGER. Be Careful!",15,30,130,"Sound_UhOhStranger");
  61.          }
  62.          else if(timer == 170)
  63.          {
  64.             STAGE.newMessage(400,75,"Good afternoon, Little Wiggi! I have some questions I\'d like you to answer!",15,30,180,"Sound_Niall1","NIALL");
  65.          }
  66.          else if(timer == 360)
  67.          {
  68.             STAGE.newMessage(400,75,"Choose the right answers to beat him at his own game!",15,30,130,"Sound_RightAnswer");
  69.          }
  70.          else if(timer == 460)
  71.          {
  72.             STAGE.newMessage(400,75,"If I send you a link to a website you\'re not sure of, should you visit?",15,30,200,"Sound_Niall2","NIALL");
  73.             rightAnswer = false;
  74.          }
  75.          else if(timer == 600)
  76.          {
  77.             convState = 1;
  78.             answerBox.ready = true;
  79.          }
  80.       }
  81.    }
  82.    else if(convState == 1)
  83.    {
  84.       timer = 0;
  85.       testSwitch = false;
  86.    }
  87.    else if(convState == 2)
  88.    {
  89.       if(userAnswer != rightAnswer and testSwitch == false)
  90.       {
  91.          timer = 0;
  92.          convState = 10;
  93.       }
  94.       testSwitch = true;
  95.       timer++;
  96.       if(bossNum == 1)
  97.       {
  98.          if(timer == 2)
  99.          {
  100.             STAGE.newMessage(400,75,"Blast, that was the right answer!",15,10,160,"Sound_XaveRight","XAVE");
  101.          }
  102.          else if(timer == 120)
  103.          {
  104.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  105.          }
  106.          else if(timer == 210)
  107.          {
  108.             STAGE.newMessage(400,75,"If I asked you to meet me in real life, would you?",15,30,120,"Sound_Xave5","XAVE");
  109.             rightAnswer = false;
  110.          }
  111.          else if(timer == 280)
  112.          {
  113.             convState = 3;
  114.             answerBox.ready = true;
  115.          }
  116.       }
  117.       else if(bossNum == 2)
  118.       {
  119.          if(timer == 2)
  120.          {
  121.             STAGE.newMessage(400,75,"Well well well, thats the right answer!",15,10,120,"Sound_TomRight","TOM");
  122.          }
  123.          else if(timer == 100)
  124.          {
  125.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  126.          }
  127.          else if(timer == 210)
  128.          {
  129.             STAGE.newMessage(400,75,"If I told you I\'m a friend of your parents online, should you ask your parents?",15,30,160,"Sound_Tom3","TOM");
  130.             rightAnswer = true;
  131.          }
  132.          else if(timer == 280)
  133.          {
  134.             convState = 3;
  135.             answerBox.ready = true;
  136.          }
  137.       }
  138.       else if(bossNum == 3)
  139.       {
  140.          if(timer == 2)
  141.          {
  142.             STAGE.newMessage(400,75,"You\'re a clever little Wiggi!",15,10,180,"Sound_NiallRight","NIALL");
  143.          }
  144.          else if(timer == 140)
  145.          {
  146.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  147.          }
  148.          else if(timer == 210)
  149.          {
  150.             STAGE.newMessage(400,75,"If I try to send you a picture, should you ask your parents to look at it first?",15,30,180,"Sound_Niall3","NIALL");
  151.             rightAnswer = true;
  152.          }
  153.          else if(timer == 330)
  154.          {
  155.             convState = 3;
  156.             answerBox.ready = true;
  157.          }
  158.       }
  159.    }
  160.    else if(convState == 3)
  161.    {
  162.       timer = 0;
  163.       testSwitch = false;
  164.    }
  165.    else if(convState == 4)
  166.    {
  167.       if(userAnswer != rightAnswer and testSwitch == false)
  168.       {
  169.          timer = 0;
  170.          convState = 10;
  171.       }
  172.       testSwitch = true;
  173.       timer++;
  174.       if(bossNum == 1)
  175.       {
  176.          if(timer == 2)
  177.          {
  178.             STAGE.newMessage(400,75,"Blast, that was the right answer!",15,10,160,"Sound_XaveRight","XAVE");
  179.          }
  180.          else if(timer == 120)
  181.          {
  182.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  183.          }
  184.          else if(timer == 210)
  185.          {
  186.             STAGE.newMessage(400,75,"But I have puppies and lots of sweet chocolates at my house...are you sure you don\'t want to visit?",15,30,160,"Sound_Xave6","XAVE");
  187.             rightAnswer = true;
  188.          }
  189.          else if(timer == 320)
  190.          {
  191.             convState = 6;
  192.             timer = 0;
  193.             answerBox.ready = true;
  194.          }
  195.       }
  196.       else if(bossNum == 2)
  197.       {
  198.          if(timer == 2)
  199.          {
  200.             STAGE.newMessage(400,75,"Well well well, thats the right answer!",15,10,120,"Sound_TomRight","TOM");
  201.          }
  202.          else if(timer == 120)
  203.          {
  204.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  205.          }
  206.          else if(timer == 210)
  207.          {
  208.             STAGE.newMessage(400,75,"If I ask you to put your webcam on, should you? ",15,30,160,"Sound_Tom4","TOM");
  209.             rightAnswer = false;
  210.          }
  211.          else if(timer == 320)
  212.          {
  213.             convState = 6;
  214.             timer = 0;
  215.             answerBox.ready = true;
  216.          }
  217.       }
  218.       else if(bossNum == 3)
  219.       {
  220.          if(timer == 2)
  221.          {
  222.             STAGE.newMessage(400,75,"You\'re a clever little Wiggi!",15,10,180,"Sound_NiallRight","NIALL");
  223.          }
  224.          else if(timer == 140)
  225.          {
  226.             STAGE.newMessage(400,75,"Well Done!",15,30,60,"Sound_WellDone");
  227.          }
  228.          else if(timer == 210)
  229.          {
  230.             STAGE.newMessage(400,75,"If I ask you to not tell your parents about me, should you tell them anyway?",15,30,160,"Sound_Niall4","NIALL");
  231.             rightAnswer = true;
  232.          }
  233.          else if(timer == 320)
  234.          {
  235.             convState = 6;
  236.             timer = 0;
  237.             answerBox.ready = true;
  238.          }
  239.       }
  240.    }
  241.    else if(convState == 6)
  242.    {
  243.       timer = 0;
  244.       testSwitch = false;
  245.    }
  246.    else if(convState == 7)
  247.    {
  248.       if(userAnswer != rightAnswer and testSwitch == false)
  249.       {
  250.          timer = 0;
  251.          convState = 10;
  252.       }
  253.       timer++;
  254.       if(bossNum == 1)
  255.       {
  256.          if(timer == 10)
  257.          {
  258.             STAGE.newMessage(400,75,"Blast it, I\'ve been foiled again by you clever little Wiggies! I\'ve got to go now! Mwahahaha",15,30,240,"Sound_XaveBeat","XAVE");
  259.             bossScale = bossSprite._xscale;
  260.          }
  261.          else if(timer > 220 and timer < 340)
  262.          {
  263.             bossSprite._xscale = - bossScale;
  264.             bossSprite._x += 4;
  265.          }
  266.          else if(timer == 340)
  267.          {
  268.             if(shortGame == false)
  269.             {
  270.                this["LEVEL" + levelID + "COMPLETE"] = true;
  271.                saveAllData();
  272.                levelID++;
  273.                fade("LOADER",10);
  274.             }
  275.             else
  276.             {
  277.                fade("SELECT",10);
  278.             }
  279.          }
  280.       }
  281.       else if(bossNum == 2)
  282.       {
  283.          if(timer == 10)
  284.          {
  285.             STAGE.newMessage(400,75,"Well, I have to go now, well done on getting the questions right!",15,30,240,"Sound_TomBeat","TOM");
  286.             bossScale = bossSprite._xscale;
  287.          }
  288.          else if(timer > 220 and timer < 340)
  289.          {
  290.             bossSprite._xscale = - bossScale;
  291.             bossSprite._x += 4;
  292.          }
  293.          else if(timer == 340)
  294.          {
  295.             if(shortGame == false)
  296.             {
  297.                this["LEVEL" + levelID + "COMPLETE"] = true;
  298.                saveAllData();
  299.                levelID++;
  300.                fade("LOADER",10);
  301.             }
  302.             else
  303.             {
  304.                fade("SELECT",10);
  305.             }
  306.          }
  307.       }
  308.       else if(bossNum == 3)
  309.       {
  310.          if(timer == 10)
  311.          {
  312.             STAGE.newMessage(400,75,"Well, it looks like I should go then, I\'m no match for you!",15,30,240,"Sound_NiallBeat","NIALL");
  313.             bossScale = bossSprite._xscale;
  314.          }
  315.          else if(timer > 220 and timer < 340)
  316.          {
  317.             bossSprite._xscale = - bossScale;
  318.             bossSprite._x += 4;
  319.          }
  320.          else if(timer == 340)
  321.          {
  322.             if(shortGame == false)
  323.             {
  324.                this["LEVEL" + levelID + "COMPLETE"] = true;
  325.                saveAllData();
  326.                levelID++;
  327.                fade("WIN",10);
  328.             }
  329.             else
  330.             {
  331.                fade("SELECT",10);
  332.             }
  333.          }
  334.       }
  335.    }
  336.    else if(convState == 10)
  337.    {
  338.       timer++;
  339.       if(bossNum == 1)
  340.       {
  341.          if(timer == 10)
  342.          {
  343.             STAGE.newMessage(400,75,"That was the wrong answer, now you must start again!",15,30,240,"Sound_XaveWrong","XAVE");
  344.          }
  345.          else if(timer == 160)
  346.          {
  347.             if(shortGame == false)
  348.             {
  349.                fade("LOADER",10);
  350.             }
  351.             else
  352.             {
  353.                fade("SELECT",10);
  354.             }
  355.          }
  356.       }
  357.       else if(bossNum == 2)
  358.       {
  359.          if(timer == 10)
  360.          {
  361.             STAGE.newMessage(400,75,"Wrong answer, I\'m afraid! Now you have to start all over again!",15,30,240,"Sound_TomWrong","TOM");
  362.          }
  363.          else if(timer == 160)
  364.          {
  365.             if(shortGame == false)
  366.             {
  367.                fade("LOADER",10);
  368.             }
  369.             else
  370.             {
  371.                fade("SELECT",10);
  372.             }
  373.          }
  374.       }
  375.       else if(bossNum == 3)
  376.       {
  377.          if(timer == 10)
  378.          {
  379.             STAGE.newMessage(400,75,"Thats not right at all...now you\'ve gotta start all over again.",15,30,240,"Sound_NiallWrong","NIALL");
  380.          }
  381.          else if(timer == 160)
  382.          {
  383.             if(shortGame == false)
  384.             {
  385.                fade("WIN",10);
  386.             }
  387.             else
  388.             {
  389.                fade("SELECT",10);
  390.             }
  391.          }
  392.       }
  393.    }
  394. }
  395. if(score == undefined)
  396. {
  397.    score = 0;
  398. }
  399. timer = 0;
  400. convState = 0;
  401. userAnswer = false;
  402.